/*河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
*/
package cn.javaxc.psi.action.supplychainmana;
import java.io.*;
import java.util.*;
import java.sql.*;
import cn.javaxc.model.base.SQL;
import cn.javaxc.model.base.SQLList;
import cn.javaxc.model.base.SQLMap;
import cn.javaxc.model.base.SQLParam;
import cn.javaxc.model.page.BatisPage;
import cn.javaxc.mvcwork.controller.web.TreeBean;
import cn.javaxc.mvcwork.util.common.CommonUtil;
import cn.javaxc.mvcwork.util.common.MapListUtil;
import cn.javaxc.mvcwork.util.helper.FrameHelper;
import cn.javaxc.mvcwork.util.helper.TreeTableHelper;
import org.springframework.beans.factory.annotation.Autowired;
import cn.javaxc.system.action.base.BaseAction;
import cn.javaxc.psi.mapper.supplychainmana.SupplierDetailedMapper;
public class SupplierDetailed extends BaseAction
{
    @Autowired(required=false)
	private SupplierDetailedMapper mapper;
    /**
    基本信息
    */
    
    public Map supplierDetailed() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> phones=mapper.phones(params);
        result.put("phones", phones);
        
        
        SQLList<SQLMap> message=mapper.message(params);
        SQLMap message_emt=message.getExistfirst();
        result.put("message", message_emt);
        
        
        SQLList<SQLMap> address=mapper.address(params);
        SQLMap address_emt=address.getExistfirst();
        result.put("address", address_emt);
        
        
        SQLList<SQLMap> email=mapper.email(params);
        result.put("email", email);
        
        return result;
    }
    /**
    增加电话号码
    */
    
    public Map supplierPhonesAdd() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> phone=mapper.phone(params);
        result.put("phone", phone);
        
        
        SQLList<SQLMap> phonetype=mapper.phonetype(params);
        result.put("phonetype", phonetype);
        
        return result;
    }
    /**
    增加电子邮件
    */
    
    public Map supplierEmalsAdd() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> mails=mapper.mails(params);
        result.put("mails", mails);
        
        
        SQLList<SQLMap> emailtype=mapper.emailtype(params);
        result.put("emailtype", emailtype);
        
        return result;
    }
    /**
    */
    
    public Map u_email() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.u_email(params);
        
        return result;
    }
    /**
    */
    
    public Map u_phones() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.u_phones(params);
        
        return result;
    }
    /**
    */
    
    public Map d_email() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.d_email(params);
        
        return result;
    }
    /**
    */
    
    public Map d_phone() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.d_phone(params);
        
        return result;
    }
    /**
    增加电话号码修改
    */
    
    public Map supplierPhonesAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        for (SQLMap emt:hqlBean.getTableElements("phones")){
            params=new SQLParam(request,emt.getMap());
            mapper.ph_id(params);
        }
        
        return result;
    }
    /**
    增加电子邮件修改
    */
    
    public Map supplierEmalsAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        for (SQLMap emt:hqlBean.getTableElements("email")){
            params=new SQLParam(request,emt.getMap());
            mapper.em_id(params);
        }
        
        return result;
    }
}